# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=gpredict
pkgver=1659.34af48e
pkgrel=1
pkgdesc='A real-time satellite tracking and orbit prediction application.'
arch=('x86_64' 'aarch64')
groups=('blackarch' 'blackarch-radio' 'blackarch-scanner')
license=('GPL')
url='http://gpredict.oz9aec.net/'
depends=('curl' 'gtk3' 'glib2' 'grig' 'goocanvas' 'hamlib')
makedepends=('git' 'intltool')
source=("git+https://github.com/csete/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  ./autogen.sh

  ./configure --prefix=/usr

  make
}

package() {
  cd $pkgname

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname" README NEWS AUTHORS \
    ChangeLog

  install -Dm 644 doc/man/gpredict.1 "$pkgdir/usr/share/man/man1/gpredict.1"

  make DESTDIR="$pkgdir" install

  rm -rf "$pkgdir/usr/share/"{gpredict,applications}
}

